package com.ruoyi.basic.service.impl;

import com.ruoyi.basic.domain.Language;
import com.ruoyi.basic.mapper.LanguageMapper;
import com.ruoyi.basic.service.ILanguageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * 语言Service业务层处理
 *
 * @author ruoyi
 * @date 2025-01-22
 */
@Service
public class LanguageServiceImpl implements ILanguageService {

    @Autowired
    private LanguageMapper languageMapper;

    /**
     * 查询语言
     *
     * @param id 语言主键
     * @return 语言
     */
    @Override
    public Language selectLanguageById(Long id) {
        return languageMapper.selectLanguageById(id);
    }

    /**
     * 查询语言列表
     *
     * @param language 语言
     * @return 语言集合
     */
    @Override
    public List<Language> selectLanguageList(Language language) {
        return languageMapper.selectLanguageList(language);
    }

    /**
     * 新增语言
     *
     * @param language 语言
     * @return 结果
     */
    @Override
    public int insertLanguage(Language language) {
        return languageMapper.insertLanguage(language);
    }

    /**
     * 修改语言
     *
     * @param language 语言
     * @return 结果
     */
    @Override
    public int updateLanguage(Language language) {
        return languageMapper.updateLanguage(language);
    }

    /**
     * 批量删除语言
     *
     * @param ids 需要删除的语言主键集合
     * @return 结果
     */
    @Override
    public int deleteLanguageByIds(Long[] ids) {
        return languageMapper.deleteLanguageByIds(ids);
    }

    /**
     * 删除语言信息
     *
     * @param id 语言主键
     * @return 结果
     */
    @Override
    public int deleteLanguageById(Long id) {
        return languageMapper.deleteLanguageById(id);
    }

    /**
     * 查询所有语言列表
     *
     * @return 语言列表
     */
    @Override
    public List<Language> selectAllLanguages() {
        return languageMapper.selectLanguageList(new Language());
    }
}